{% extends "PATHomeBundle::base.html.twig" %}
{% block body %}
       <div class="tunnelCartImg">
            <div class="tunnelShoppingCart"></div>
            <div class="tunnelTruck"></div>
            <div class="tunnelCards"></div>
            <div class="tunnelOrder"></div>
        </div>
<h1>Récapitulatif de la commande</h1>

    <div class="orderRecap">
        <table class="orderAddresses">
            <tr>
                <td>Adresse de livraison</td>
                <td>
                    {{ deliveryAddress.street }}
                    {{ deliveryAddress.postalCode }}
                    {{ deliveryAddress.city }}
                    {{deliveryAddress.country }}
                </td>
            </tr>
            <tr>
                <td>Adresse de paiement</td>
                <td>
                    {{ paymentAddress.street }} 
                    {{ paymentAddress.postalCode }} 
                    {{ paymentAddress.city }} 
                    {{paymentAddress.country }}
                </td>
            </tr>
            <tr>
                <td>Mode de paiement</td>
                <td>{{ paymentMode }}</td>
            </tr>
        </table>
        <table class="orderDetail">
            <tbody>
            <tr class="product">
                <td class='pic'>Image</td>
                <td class='name'>Produit</td>
                <td class='priceHT'>Prix unitaire</td>
                <td class='quantity'>Quantité</td>
                <td class='sum'>Sous-total</td>
            </tr>

    {% for indice, productArray in displayArray %}

                <tr class="product">
                    <td class='pic'><img src="{{ productArray.product.picture.getUrl() }}" alt="pic" /></td>
                    <td class='name'> {{ productArray.product.name }} </td>
                    <td class='priceHT'> {{ productArray.product.priceHT }} €</td>
                    <td class='quantity'> {{ productArray.quantity }}</td>
                    <td class='sum'>{{ productArray.sum }} €</td>
                </tr>
    {% endfor %}
            </tbody>
        </table>

        <table class="orderSumUp">
            <tbody>
                <tr>
                    <td>Total Hors taxes</td>
                    <td>Frais de port</td>
                    <td>TVA</td>
                    <td>Net à Payer</td>
                </tr>
                <td>{{ totalPriceHT }} €</td>
                <td>{{ shippingCost }} €</td>
                <td>{{ feeRate }} %</td>
                <td>{{ totalPriceHT }} €</td>
            </tbody>
        </table>
        
    </div>
    <a href="#" onClick="javascript:history.back();" class="generic_link">Retour</a>
    <a href="{{ path('pat_cart_displaysteps', { 'step':'5' }) }}" class="generic_link confirmCommand">Valider</a>
    {% endblock body%}